#include "test_share_mem.h"

struct share_buffer sbf;
DATA_ALL *sbf_pdata;//代替：((DATA_ALL *)p_sbf->pdata)

void test_sharemem_server_build(struct share_buffer *sb,int ftok_id)
{
    int intkey=get_key(ftok_id,s_PROGRM_MAIN_PATH);
    sharemem_server_build(sb, sizeof(DATA_ALL),USR_SEMID_COUNT,intkey);
     write_sharemem_files(ftok_id,sb, sizeof(DATA_ALL),USR_SEMID_COUNT,intkey);
    sbf_pdata=(DATA_ALL *)(sb->pdata);
}
void test_sharemem_client_build(struct share_buffer *sb,int ftok_id)
{
    int intkey=get_key(ftok_id,s_PROGRM_MAIN_PATH);
    sharemem_client_build(sb,sizeof(DATA_ALL),USR_SEMID_COUNT,intkey);
    sbf_pdata=(DATA_ALL *)(sb->pdata);

}


double* get_python_pointer(struct share_buffer *sb)
{
    DATA_ALL *buffer;
    buffer = (DATA_ALL *)(sb->pdata);
    return &(buffer->test_dbl[0]);
}